cmake_minimum_required(VERSION 3.16) 

# 设置交叉编译工具路径 --> (需根据自己实际路径进行修改)
set(CROSS_COMPILER_DIR /opt/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3-1)
# 指定交叉编译工具所使用的C语言编译器
set(CMAKE_C_COMPILER ${CROSS_COMPILER_DIR}/bin/loongarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER_DIR}/bin/loongarch64-linux-gnu-g++)
# project name
project(main)
# source file path
aux_source_directory(${PROJECT_SOURCE_DIR}/../src SRC)
# include file path
include_directories(${PROJECT_SOURCE_DIR}/../inc)


add_executable(main main.c ${SRC})